package com.pkk.cloud.support.gateway.limiter.limit.annotations;

import com.pkk.cloud.support.gateway.limiter.limit.aop.RateLimitAspect;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;

/**
 * @description: 请求限制
 * @author: peikunkun
 * @create: 2020-03-24 13:56
 **/
@Documented
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@EnableAspectJAutoProxy
@Import(RateLimitAspect.class)
public @interface RateLimit {

  /**
   * 接口限制多少,默认不限制
   *
   * @return
   */
  int limitNum() default -1;

}
